package com.socket;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class TCPSocketServer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ServerSocket ss=null;
		try {
			ss=new ServerSocket(1234);
			while(true){
				Socket s=ss.accept();
				DataInputStream ds=new DataInputStream(s.getInputStream());
				Long l=ds.readLong();
				System.out.println("receive="+s.getLocalAddress()+"\n"+s.getLocalPort()
					+s.getInetAddress()+"\n"+s.getReceiveBufferSize()+"\n"+l);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}

}
